﻿using System;
using System.IO;
using YArchitech.LIB;
using libxl;

namespace HYElectricSetting
{
	public static class CableManageCommon
	{
		public static string GetElectricTempFile()
		{
			return Path.Combine(Product.UserDataLocation, "HyElectricTemp.xml");
		}

		public static string ReadExcelCell(Sheet sheet, int row, int col)
		{
			bool flag = sheet == null;
			string result;
			if (flag)
			{
				result = string.Empty;
			}
			else
			{
				string text = string.Empty;
				try
				{
					CellType cellType = sheet.cellType(row, col);
					bool flag2 = cellType == CellType.CELLTYPE_NUMBER;
					if (flag2)
					{
						text = sheet.readNum(row, col).ToString();
					}
					else
					{
						bool flag3 = cellType == CellType.CELLTYPE_STRING;
						if (flag3)
						{
							text = sheet.readStr(row, col);
						}
						else
						{
							bool flag4 = cellType == CellType.CELLTYPE_BOOLEAN;
							if (flag4)
							{
								text = sheet.readBool(row, col).ToString();
							}
						}
					}
					result = text;
				}
				catch (System.Exception)
				{
					result = string.Empty;
				}
			}
			return result;
		}
	}
}
